package com.demo.idempotent.aspect;

public class IdempotentFlag {
    private static final String flag = "1";


    private static ThreadLocal<String> idempontent = new ThreadLocal<>();

    public static void doing() {
        idempontent.set(flag);
    }

    public static boolean isDoing() {
        if (flag.equals(idempontent.get())) {
            return true;
        }
        return false;
    }

    public static void done() {
        idempontent.remove();
    }
}
